package com.hzy.orderSystem.service.impl;

import com.hzy.orderSystem.dao.UserDao;
import com.hzy.orderSystem.entities.User;
import com.hzy.orderSystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.Page;

/**
 * @author 小宝
 * @create 2021/4/16 13:59
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public User getUserByUsernameAndPassword(String username, String password) {
        return userDao.getUserByUsernameAndPassword(username, password);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public User getUserByUsername(String username) {
        return userDao.getUserByUsername(username);
    }

    @Override
    public int save(User user) {
        return userDao.save(user);
    }

    @Override
    public Page<User> getUsersByStatus(int status) {
        return userDao.getUsersByStatus(status);
    }
}
